package test;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.json.JSONException;

import partlow.googleplaces.GooglePlacesAPI;
import partlow.googleplaces.GooglePlacesException;
import partlow.googleplaces.datatypes.Place;
import partlow.yelp.YelpApiV2;
import partlow.yelp.YelpException;
import partlow.yelp.datatypes.Business;

public class Parserer {

	public static void main(String[] args) throws MalformedURLException, IOException, YelpException, GooglePlacesException, JSONException {
		
		testYelp();
	}
	
	private static void testYelp() throws MalformedURLException, IOException, YelpException, JSONException {
		YelpApiV2 yelpApiV2 = new YelpApiV2();
		
		Map<String, String> queryMap = new HashMap<String, String>();
		queryMap.put("radius_filter", "40000");
		//queryMap.put("category_filter", "restaurants");
		queryMap.put("ll", "39.1447063602562,-76.68594360351562");
		
		Collection<Business> businesses = yelpApiV2.getBusinesses(queryMap);
		System.out.print(businesses);
	}
	
	@SuppressWarnings("unused")
	private static void testGooglePlace() throws GooglePlacesException, IOException, JSONException {
		GooglePlacesAPI googlePlacesAPI = new GooglePlacesAPI();
		
		Map<String, String> queryMap = new HashMap<String, String>();
		queryMap.put("radius", "40000");
		queryMap.put("sensor", "false");
		queryMap.put("location", "39.1447063602562,-76.68594360351562");
		queryMap.put("types", "food");
		
		Collection<Place> places = googlePlacesAPI.getPlaces(queryMap);
		System.out.print(places);
	}
}
